﻿using System.Collections.Generic;
using NUnit.Framework;
using PS.WssSync.Utils;

namespace PS.WssSync.Tests
{
    [TestFixture]
    public class SerializationTests
    {
        private XmlSerializationHelper<WssSyncConfig> helper;

        [TestFixtureSetUp]
        public void SetUp()
        {          
        }

        [Test]
        public void SerializationTest()
        {
            helper = new XmlSerializationHelper<WssSyncConfig>();
            WssSyncConfig filters = new WssSyncConfig();

            var filtersCollection = new List<Filter>();
            filtersCollection.Add(new Extension("eee"));
            filtersCollection.Add(new Folder("fff"));
            filtersCollection.Add(new Regexp("ggg"));

            filters.AllowFilters.AddRange(filtersCollection);

            filtersCollection = new List<Filter>();
            filtersCollection.Add(new Extension("eee"));
            filtersCollection.Add(new Folder("fff"));
            filtersCollection.Add(new Regexp("ggg"));

            filters.IgnoreFilters.AddRange(filtersCollection);

            filters.SiteLocation = "http://localhost";

            string result = helper.Serialize(filters);
        }

        [Test]
        public void DeSerializationTest()
        {
            helper = new XmlSerializationHelper<WssSyncConfig>();

            WssSyncConfig result =
                helper.DeserializeFromFile(@"E:\Evgeniy\Projects\PS.Tools.SharepointSync\PS.SharePointSync\WssSync.config");                  
        }
    }
}
